import React, { Component } from 'react';
import './index.less';
import Main from './images/main.jpg';
// import axios from '@/components/service/request';     //接口
import { BrowserRouter, NavLink, Routes,Link} from "react-router-dom";
import {NotificationTwoTone , ScheduleTwoTone,FileWordTwoTone ,RocketTwoTone,RightCircleTwoTone,DownloadOutlined, FolderOpenTwoTone } from '@ant-design/icons';
import Overview from './Overview';
import Academicteam from './academicteam';
import Researchplatform from './researchplatform';
import Opencommunication from './opencommunication';
import Datadownload from './datadownload';
import InformationCenter from './Informationcenter';
import Construction from './labconstruction';
import Home from './home'
import { Route } from 'react-router-dom';
import { Switch } from 'react-router-dom/cjs/react-router-dom.min';


class Web extends Component {
  constructor(props) {
    super(props);
    this.state = { 
      // selectedNav: null
    };
  }
  componentDidMount() {
    // handleNavClick = (index) => {
    //   this.setState({ selectedNav: index });
    // }
  }
  render() {
    return (
          <div id="main">
            <div>
              <div className={'line-box'}>
                <a href="">返回首页</a>
                <a href="">设为首页  <span>&nbsp;&nbsp;&nbsp;</span>|</a>
                <span id="li-6"><Link to="/Login">用户登录  <span>&nbsp;&nbsp;&nbsp;</span>  |</Link></span>
              </div>
              <div className={'mainlogo-box'}>
                <img src={Main} alt={'Main'} style={{ width: "94%", height: "248px" }} />
              </div>
            </div>
            {/* <!-- start --> */}
            <BrowserRouter>         
            <nav className={'nav'}>
            <ul className={'main'}>
                <li><NavLink to="/Web" className="navtext">首页</NavLink></li>
                <li><NavLink to="/overview" className="navtext">实验室概况</NavLink></li>
                <li><NavLink to="/academicteam" className="navtext">学术队伍</NavLink></li>
                <li><NavLink to="/construction" className="navtext">实验室建设</NavLink></li>
                <li><NavLink to="/researchplatform" className="navtext">科研平台</NavLink></li>
                <li><NavLink to="/opencommunication" className="navtext">开放交流</NavLink></li>
                <li><NavLink to="/datadownload" className="navtext">资料下载</NavLink></li>
                <li><NavLink to="/informationcenter" className="navtext">信息中心</NavLink></li> 
              </ul>
            </nav>
              <Switch>
                <Route exact path="/Web" component={Home} /> 
                <Route exact path="/overview" render={() => <Overview />}/> 
                <Route exact path="/academicteam" component={Academicteam} /> 
                <Route exact path="/construction" component={Construction} /> 
                <Route exact path="/researchplatform" component={Researchplatform} /> 
                <Route exact path="/opencommunication" component={Opencommunication} /> 
                <Route exact path="/datadownload" render={() => <Datadownload />} /> 
                <Route exact path="/informationcenter" component={InformationCenter} /> 
              </Switch>            
            </BrowserRouter>

          </div>
    )
  }
}
export default Web;